<template>
	<view class="content" style="min-height: 100vh; background: #FFFFFF;">
		<view class="display-flex " style="padding: 30rpx;">
			<view class="font-size-26" style="width: 33.33333%;">
				时间
			</view>

			<view class="font-size-26 text-center" style="width: 33.33333%;">
				数量
			</view>
			<view class="font-size-26 text-center" style="width: 33.33333%;">
				状态
			</view>
			<uv-gap height="1" bgColor="#F5F5F5"></uv-gap>
		</view>
		<view class="">
			<view v-for="item,index in list" :key="index" class="">
				<view class="display-flex " style="padding: 30rpx;">
					<view class="font-size-26" style="width: 33.33333%;">
						{{timestampToDate(item.createtime * 1000,'Y-m-d')}}
					</view>
					<view class="font-size-26 text-center" style="width: 33.33333%;">
						{{item.account}}
					</view>
					<view v-if="item.status == 1"  class="font-size-26 text-center" style="color: green; width: 33.33333%;">
						成功
					</view>
					<view v-if="item.status == 0" class="font-size-26 text-center" style="color: red;width: 33.33333%;">
						拒绝
					</view>
					<view v-if="item.status == 2" class="font-size-26 text-center" style="color: yellow;width: 33.33333%;">
						审核
					</view>
				</view>
				<uv-gap height="1" bgColor="#F5F5F5"></uv-gap>
			</view>
		</view>
	</view>
</template>

<script setup>
	import {
		ref,
		reactive
	} from 'vue';
	import {
		onLoad,
		onShow,
		onReady,
		onReachBottom
	} from '@dcloudio/uni-app';
	import {
		nativeUI,
		navigateTo,
		navigateBack,
		timestampToDate
	} from '@/utils/index.js';
	import * as api from '@/request/app.js'; // 引入api 方法
	import local from '@/utils/localStorage.js'; //引入本地存储方法
	//分页
	const pagingState = ref(false)
	const page = ref(1)
	const list = ref([])
	onLoad(function(option) {
		withdraw_list()
	});
	onShow(function() {});
	async function withdraw_list() {
		if (!pagingState.value) {
			const {
				code,
				data
			} = await api.withdraw_list({
				page: page.value
			})
			list.value = list.value.concat(data.data)
			if (data.current_page == data.last_page) {
				pagingState.value = true
				return
			}
			page.value++
		}
	}
	onReady(function() {});
	onReachBottom(function() {
		withdraw_list()
	});
</script>

<style scoped lang="scss">
</style>